const { defineConfig } = require('@vue/cli-service')

module.exports = defineConfig({
  transpileDependencies: true,
  pluginOptions: {
    electronBuilder: {
      mainProcessFile: 'src/background.js',
      builderOptions: {
        productName: 'Electron Vue App',
        appId: 'aiTest.ezcoder.cn',
        win: {
          icon: 'public/icon.ico'
        },
        mac: {
          icon: 'public/icon.icns'
        },
        linux: {
          icon: 'public/icon.png'
        }
      },
      nodeIntegration: true,
      devtools: false // 禁用 Vue Devtools 的自动安装
    }
  },
  // 开发服务器配置
  devServer: {
    port: 8080,
    proxy: {
      '/api': {
        target: 'http://localhost:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api': ''
        },
        // 设置支持 https
        secure: false
      }
    }
  }
})